1 module directx.d3dx11core; 2 /////////////////////////////////////////////////////////////////////////// 3 // 4 // Copyright (C) Microsoft Corporation. All Rights Reserved. 5 // 6 // File: d3dx11core.h 7 // Content: D3DX11 core types and functions 8 // 9 /////////////////////////////////////////////////////////////////////////// 10 11 version(Windows): 12 version(Direct3D_11): 13 14 import directx.win32; 15 import directx.com; 16 import directx.d3d11; 17 18 // TODO: better handling to dll version name 19 20 // Current name of the DLL shipped in the same SDK as this header. 21 22 enum D3DX11_DLL_W = "d3dx11_43.dll"w; 23 enum D3DX11_DLL_A = "d3dx11_43.dll"; 24 25 alias D3DX11_DLL_W D3DX11_DLL; 26 27 /////////////////////////////////////////////////////////////////////////// 28 // D3DX11_SDK_VERSION: 29 // ----------------- 30 // This identifier is passed to D3DX11CheckVersion in order to ensure that an 31 // application was built against the correct header files and lib files. 32 // This number is incremented whenever a header (or other) change would 33 // require applications to be rebuilt. If the version doesn't match, 34 // D3DX11CreateVersion will return FALSE. (The number itself has no meaning.) 35 /////////////////////////////////////////////////////////////////////////// 36 37 38 enum D3DX11_SDK_VERSION = 43; 39 40 41 version(D3D_DIAG_DLL) 42 extern(Windows) BOOL D3DX11DebugMute(BOOL Mute); 43 44 extern(Windows) HRESULT D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion); 45 46 47 ////////////////////////////////////////////////////////////////////////////// 48 // ID3DX11ThreadPump: 49 ////////////////////////////////////////////////////////////////////////////// 50 51 interface ID3DX11DataLoader 52 { 53 extern(Windows): 54 HRESULT Load(); 55 HRESULT Decompress(void** ppData, SIZE_T* pcBytes); 56 HRESULT Destroy(); 57 } 58 59 interface ID3DX11DataProcessor 60 { 61 extern(Windows): 62 HRESULT Process(void* pData, SIZE_T cBytes); 63 HRESULT CreateDeviceObject(void** ppDataObject); 64 HRESULT Destroy(); 65 } 66 67 mixin( uuid!(ID3DX11ThreadPump, "C93FECFA-6967-478a-ABBC-402D90621FCB") ); 68 interface ID3DX11ThreadPump : IUnknown 69 { 70 extern(Windows): 71 HRESULT AddWorkItem(ID3DX11DataLoader pDataLoader, ID3DX11DataProcessor pDataProcessor, HRESULT* pHResult, void** ppDeviceObject); 72 UINT GetWorkItemCount(); 73 74 HRESULT WaitForAllItems(); 75 HRESULT ProcessDeviceWorkItems(UINT iWorkItemCount); 76 77 HRESULT PurgeAllItems(); 78 HRESULT GetQueueStatus(UINT* pIoQueue, UINT* pProcessQueue, UINT* pDeviceQueue); 79 } 80 81 82 extern(Windows) HRESULT D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump* ppThreadPump); 83 84 extern(Windows) HRESULT D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext pContext); 85 86 87 88 /////////////////////////////////////////////////////////////////////////// 89 90 enum _FACD3D = 0x876; 91 92 HRESULT MAKE_D3DHRESULT(T)(T code) { 93 return MAKE_HRESULT(1, _FACD3D, code); 94 } 95 96 HRESULT MAKE_D3DSTATUS(T)(T code) { 97 return MAKE_HRESULT(0, _FACD3D, code); 98 } 99 100 enum D3DERR_INVALIDCALL = MAKE_D3DHRESULT(2156); 101 enum D3DERR_WASSTILLDRAWING = MAKE_D3DHRESULT(540);